/*
 * @Author: boyyang
 * @Date: 2022-02-22 09:22:46
 * @LastEditTime: 2022-03-18 21:30:38
 * @LastEditors: boyyang
 * @Description: 判断数据类型
 * @FilePath: \boyyang\src\utils\dataType.ts
 */

/**
 * @description: 判断数据类型
 * @param {*} T
 * @return {string} 'string','number','object','function' ,'symbol'
 */
const dataType = <T>(val : T) : string => {
    let type = Object.prototype.toString.call(val).split(' ')[1].split('').slice(0, -1).join('').toLowerCase()
    return type
}

export {
    dataType
}
